package com.haotian.coder.config;


import dev.langchain4j.community.store.memory.chat.redis.RedisChatMemoryStore;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
@ConfigurationProperties(prefix = "spring.data.redis")
@Data
public class RedisChatMemoryConfig {

    private String host;

    private int port;

    private long ttl;


    @Bean
    public RedisChatMemoryStore redisChatMemoryStore() {

        RedisChatMemoryStore redisChatMemoryStore = RedisChatMemoryStore.builder()
                .host(host)
                .port(port)
                .ttl(ttl)
                .build();

        return redisChatMemoryStore;
    }
}
